
  import request from '@/utils/request'

  export function fetchListty(query) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type',
      method: 'get',
      params: query
    })
  }
  
  export function fetchArticle(id) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type',
      method: 'get',
      params: { id }
    })
  }
  
  export function fetchPv(pv) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type',
      method: 'get',
      params: { pv }
    })
  }
  
  export function createArticle(data) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type',
      method: 'post',
      data
    })
  }
  
  export function updateArticle(data,id) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type'+data.id,
      method: 'put',
      data
    })
  }

  export function deleteArticle(data) {
    return request({
      url: 'https://localhost:44341/api/app/commodity-type'+data.id,
      method: 'delete',
      data
    })
  }
  